package com.whsr.readservice.util;

import com.whsr.readservice.service.DownBookMaintainService;

import javax.servlet.ServletContext;

public class JobThread implements Runnable{

    private DownBookMaintainService downBookMaintainService;
    private ServletContext applicContext;

    public JobThread(DownBookMaintainService downBookMaintainService, ServletContext applicContext) {
        this.downBookMaintainService = downBookMaintainService;
        this.applicContext = applicContext;
    }

    @Override
    public void run() {
        downBookMaintainService.downBookJob(1);
        applicContext.removeAttribute("start");
    }
}
